package cn.itcast.bitmapdemo;

import androidx.appcompat.app.AppCompatActivity;

import android.graphics.drawable.Animatable;
import android.graphics.drawable.AnimationDrawable;
import android.graphics.drawable.Drawable;
import android.media.Image;
import android.os.Bundle;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;

public class MainActivity extends AppCompatActivity {
    MyView myView;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        init();
    }

    private void init() {
        myView = findViewById(R.id.myview);
        myView.setTranslationX(30.0f);

    }

    public void startAnimation(View view) {
        Animation animation = AnimationUtils.loadAnimation(this,R.anim.alpha_animation);
        myView.startAnimation(animation);



    }


}